package com.gitee.wsl.coroutines.executor.dispatcher

import kotlinx.coroutines.Delay
import kotlinx.coroutines.InternalCoroutinesApi
import kotlinx.coroutines.Runnable
import kotlin.coroutines.CoroutineContext


/** The base interface of [CoroutineContext] for dispatchers. */
@OptIn(InternalCoroutinesApi::class)
interface KtDispatcher : CoroutineContext, Delay {

    /** Immediately executes the passed [block]. */
    fun execute(block: Runnable)

    /** Schedules the execution of the passed [block]. */
    fun queue(block: Runnable)
}